package com.commerce.pojo.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

@Data
@TableName("commodity")
public class Commodity {
    /**
     * 商品id
     */
    @TableId(value = "id", type = IdType.AUTO) //指定id类型为自增长
    private long id;
    /**
     * 图片地址
     */
    private String img;
    /**
     * 商品简介
     */
    private String intro;
    /**
     * 商品详情
     */
    private String detail;
    /**
     * 商品名
     */
    private String name;
    /**
     * 商品单价
     */
    private double price;
    /**
     * 商品状态
     */
    private long state;
    /**
     * 卖家id
     */
    private long userId;
    /**
     * 卖家姓名
     */
    private String userName;


    public Commodity() {
    }

    public Commodity(String img, String intro, String detail, String name, double price, long state, long userId, String userName) {
        this.img = img;
        this.intro = intro;
        this.detail = detail;
        this.name = name;
        this.price = price;
        this.state = state;
        this.userId = userId;
        this.userName = userName;
    }

    public Commodity(long id, String img, String intro, String detail, String name, double price, long state, long userId, String userName) {
        this.id = id;
        this.img = img;
        this.intro = intro;
        this.detail = detail;
        this.name = name;
        this.price = price;
        this.state = state;
        this.userId = userId;
        this.userName = userName;
    }
}
